////////////////////////////////////////////////////////////////////
///
///   StringUtils.h
///
///   Copyright (C) 2007 ScalingWeb.com
///   All rights reserved. 
/// 
///   Authors: Yuriy Soroka <ysoroka@scalingweb.com>
///	       Anton Fedoruk <afedoruk@scalingweb.com>
///
/// 
///////////////////////////////////////////////////////////////////


#ifndef __StringUtils_h__
#define __StringUtils_h__

#include <string>
#include <QByteArray>
#include "JBufferString.h"

///	class StringTokenizer

///
///	Simple and fast variant of StringTokenizer class
///

class StringTokenizer
{
public:

	StringTokenizer( const std::string &strToken, const std::string &strDelimiter );
	StringTokenizer( const char *strToken, const char *strDelimiter );

	~StringTokenizer();

	/// Get next token
	bool nextToken( std::string &strText );
	bool nextToken( QByteArray &strText );
	bool nextToken( JBufferString &strText );

private:

	bool mFirst;
	char *mcstr;
	char *mdelim;
};

#endif // __StringUtils_h__

